home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11615 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: ix.netcom.com!netnews
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Automatic  Data Segm exceeds 64 K
  5. Date: 15 Mar 1996 02:37:08 GMT
  6. Organization: Netcom
  7. Message-ID: <4ial4k$3s0@ixnews3.ix.netcom.com>
  8. References: <juanjose.74.002CFB27@melbpc.org.au>
  9. NNTP-Posting-Host: den-co10-19.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Thu Mar 14  6:37:08 PM PST 1996
  13. Keywords: C++ segment problems
  14. X-Newsreader: WinVN 0.99.7
  15.  
  16. In article <juanjose.74.002CFB27@melbpc.org.au>, juanjose@melbpc.org.au 
  17. says...
  18. >
  19. >hI!
  20. >If you have a solution for this problem, please send me a few lines with 
  21. >indications. I am not a C programmer, and in a program I am having errors 
  22. >like:"Linker Error: Automatic data segment exceeds 64K" or some times "A1 
  23. >overlaps ... DGROUP ..."
  24. >I am using Borland C++ v3.5 as compiler...
  25. >
  26. >I sumarize the problem, in the next 2 samples of code.. They are just a 
  27. summary extracted from the DLL source, (without the LibMain & WEP an
  28. >
  29. >Sample of SOURCE FILE MYINCLUDE.H:
  30. >----------------------------------
  31. >  ......
  32. >  extern "C" int FAR PASCAL _export allocmem (void);
  33. >  extern "C" int FAR PASCAL _export movmem(void);
  34. >
  35. >  HANDLE   hptr[500];              //hndl to allocmem
  36. >  char far *ttt[500];              //pointer to allocated memory
  37. >  .....
  38.  
  39. I am dubious about putting data declarations in a header file, because
  40. that may create a separate copy of the data in each module that includes
  41. the header...
  42.  
  43. Other than that, try two things:
  44. 1) Change the above code to
  45.      HANDLE far hptr[500];              //hndl to allocmem
  46.      char far * far ttt[500];              //pointer to allocated memory
  47. The extra 'far' causes allocation in another segment.
  48.  
  49. 2) Set the 'far data threshold' to a small value like 256.  I don't
  50.   know how this is done in Borland C++ 3.5.  In 4.5 it is under
  51.   Options/Project/16-bit Compiler.
  52.  
  53. john lilley
  54.  
  55.